import { Component, OnInit } from '@angular/core';
import { BladeService } from "../../../shared/blade.service";
import { BladeData } from "../../../shared/blade/blade-data";
import { Observable } from "rxjs/Observable";
import { PhaseListComponent } from "./phase-list/phase-list.component";
import { Blade } from "../../../shared/blade/blade.model";

@Component({
  selector: 'app-phase',
  templateUrl: './phase.component.html',
  styleUrls: ['./phase.component.css'],
  providers: [BladeService]
})
export class PhaseComponent implements OnInit {
   /**
   * 当前弹出层
   * 
   * @type {Blade}
   * @memberof BladeContainerInterface
   */
   currentBlade: Blade;
  constructor(public bladeService: BladeService) { }

  ngOnInit() {
    this.createPhaseListtBlade()
  }
  /**
   * 创建工期列表弹出层
   * 
   * 
   * @memberof DicComponent
   */
  createPhaseListtBlade() {
    let data: BladeData = new BladeData();
    data.id = "phaseList";
    data.title = "工期列表";    
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(PhaseListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }
   /**
   * 是否可以离开
   * 
   * 
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}



// WEBPACK FOOTER //
// ./src/app/module/basic/phase/phase.component.ts